package com.edu.exam.enums.grading;

/**
 * 结果类型枚举
 */
public enum ResultType {
    STATISTICS("STATISTICS", "描述性统计"),
    DISTRIBUTION("DISTRIBUTION", "分布分析"),
    CORRELATION("CORRELATION", "相关性分析"),
    TREND("TREND", "趋势分析"),
    MULTIDIMENSIONAL("MULTIDIMENSIONAL", "多维分析"),
    CLUSTER("CLUSTER", "聚类分析"),
    PREDICTION("PREDICTION", "预测分析"),
    ANOMALY("ANOMALY", "异常检测"),
    COMPARISON("COMPARISON", "对比分析"),
    COMPREHENSIVE("COMPREHENSIVE", "综合分析");

    private final String code;
    private final String description;

    ResultType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static ResultType fromCode(String code) {
        for (ResultType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return STATISTICS; // 默认返回描述性统计
    }
}